<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>事件类型</title>
</head>
<body>
  <div id="d1" style="width: 100px;height: 100px;border: 1px solid; overflow: auto;">我是div标签我是div标签我是div标签我是div标签我是div标签我是div标签我是div标签我是div标签我是div标签我是div标签我是div标签</div>
  <input type="text" id="input1">
  <script>
    // 失去焦点 blur事件
    var input1=document.getElementById('input1');
    input1.onblur=function(){
      console.log('失去焦点');
      console.log(this.value);
    }
    // 聚焦事件focus
    input1.onfocus=function(){
      console.log('我聚焦了');
    }


    // 获取div
    var div=document.getElementById('d1');
    // 鼠标滚动事件 scroll
    div.onscroll=function(){
      console.log('我一直在滚动');
    }
    
  </script>
</body>
</html>